from rest_framework import serializers

from activity.models import Gathering


# 活动列表
class GatheringSerializer(serializers.ModelSerializer):
    users = serializers.PrimaryKeyRelatedField(read_only=True,many=True)
    class Meta:
        model = Gathering
        fields = ('id','name','image','city','starttime','endrolltime','users')


# 活动详情
class GatheringDetailsSerializer(serializers.ModelSerializer):
    users = serializers.PrimaryKeyRelatedField(read_only=True,many=True)
    class Meta:
        model = Gathering
        fields = '__all__'
